<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
	<link rel = "Shortcut Icon" href="http://www.kaishengit.com/favicon.ico" />
	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/bootstrap-dropdown.js"></script>
</head>
<body>
	<div class="container">
		<div class="navbar">
			<div class="navbar-inner">
				<div class="container">
					<a href="main" class="brand">凯盛项目管理系统</a>
					<ul class="nav pull-right">
						<li class="active">
							<a>${sessionScope.user.name }</a>
						</li>
						<li>
							<a href="user">个人资料</a>
						</li>
						<li class="divider-vertical"></li>
						<li>
							<a href="loginout">安全退出</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span3">
				<div class="wall">
					<ul class="nav nav-list">
						<li class="nav-header">${project.name }</li>
						<li class="divider"></li>
						<li>
							<a href="project?id=${project.id }">
								<i class=" icon-home"></i>最新动态
							</a>
						</li>
						<li>
							<a href="goal">
								<i class="icon-flag"></i>目标
							</a>
						</li>
						<li>
							<a href="document">
								<i class="icon-folder-open"></i>资料库
							</a>
						</li>
						<li>
							<a href="folder">
								<i class="icon-file"></i>文件共享
							</a>
						</li>
						<li>
							<a href="contact">
								<i class="icon-user"></i>联系人
							</a>
						</li>
						<li  class="active">
							<a href="idea">
								<i class="icon-white icon-fire"></i>想法
							</a>
						</li>
						<li>
							<a href="project?m=edit">
								<i class="icon-cog"></i>项目设置
							</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="span9">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="icon-fire"></i>想法
                    </li>
                    <li class="pull-right">
                        <a href="idea?m=new" class="link-black">
                            <i class="icon-plus"></i>发表新想法
                        </a>
                    </li>
                </ul>
                <div class="wall">
                	<c:forEach var="idea" items="${ideas.result }">
                		<blockquote>
	                        <h4>
	                            <a href="idea?m=show&id=${idea.id }">${idea.title }</a>
	                        </h4>
	                        <p style="font-size:14px">${fn:substring(idea.context, 0, 100) }<c:if test ="${fn:length(idea.context) > 50 }" ><span>........</span></c:if></p> 
	                        <small class="pull-right">
	                            ${idea.userName } 发布于 ${idea.strTime }
	                        </small>
	                        <div class="clear"></div>
	                        <a href="idea?m=edit&id=${idea.id }">
	                            <i class="icon-pencil"></i>
	                        </a>
	                        <a href="idea?m=del&id=${idea.id }" class="del">
	                            <i class="icon-trash"></i>
	                        </a>
	                    </blockquote>
                	</c:forEach>
                    <div class="pagination pull-right">
							<ul>
							  	<c:choose>
							  		<c:when test="${ideas.nowPageNum != 1 }">
							  			  <li><a href="idea?p=${ideas.nowPageNum - 1 }">上一页</a></li>
							  		</c:when>
							  	</c:choose>
							  	<c:choose>
							  		<c:when test="${ideas.nowPageNum != ideas.totalPages }">
							  			<li><a href="idea?p=${ideas.nowPageNum + 1 }">下一页</a></li>
							  		</c:when>
							  	</c:choose>
							</ul>
						</div>
                    <div class="clear"></div>
                </div>
            </div>
        </div>
    </div>
     <script type="text/javascript">
    	$(".del").click(function() {
    			var msg = "你真的要删除吗？";
    			if (!confirm(msg)){
					return false;	
				}
    		});
    </script>
</body>
</html>